]> dgit.raspbian.org Git - gnome-shell.git/commit
workspaceAnimation: Get time outside of the animation-complete callback
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 7 Mar 2022 14:34:25 +0000 (15:34 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sun, 13 Mar 2022 00:06:03 +0000 (00:06 +0000)
commitaa9edc37a57e5267237c7c998d035eb2042e43eb
tree17b2af2f9eda5813821af94e7e4f92caf77a449f
parent4bc195e79714f1c6787e05728a62e25b5b353040
workspaceAnimation: Get time outside of the animation-complete callback

We want to use the current event time for activating the workspace, and
this time is only available when calling global.get_current_time() or
Clutter.get_current_event_time() from the context of an event handler.

So instead of trying to get that time when the animation has finished
from the onComplete() handler, get it before and store it as a variable
to use in the onComplete() handler later.

This fixes an error message when switching workspaces using the swipe
gesture where MetaWorkspace complains about the 0-timestamp we pass it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2233>
js/ui/workspaceAnimation.js